package com.hskj.springbootes.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//这是一个配置类
@Configuration
public class ESConfig {

    /**
     * RestHighLevelClient主要配置连接es的
     * @return
     */
    @Bean
    public RestHighLevelClient restHighLevelClient(){
        return new RestHighLevelClient(RestClient.builder(
                new HttpHost("192.168.195.129",9200,"http")
        ));
    }
}
